<%= render :partial =>'/store/toolbar'%>
<div id="content_container">
  <div style="width:600px;margin:20px auto">
    <h2>不可用颜色列表</h2>

    <%= form_tag('reactive', :method => :post)%>
    <table class="admin">
      <tr>
        <td>ID</td>
        <td>缩略图</td>
        <td>数量</td>
        <td>选中</td>
      </tr>

      <% for @material in @materials %>
        <tr>
          <td><%=@material.id%></td>
          <td><%= image_tag url_for_file_column(@material, "image_url","medium") if @material.image_url %></td>
          <td><%=text_field("material[]", "quantity", :size => 2)%></td>
          <td><%=check_box("material[]","active")%></td>
        </tr>
      <% end %>
      <tfoot>
        <tr>
          <td colspan="4">
            <button  type="sumbit">修改为可用</button>
            <span class="tips">*数量为0不能改为可用</span>
          </td>
        </tr>
      </tfoot>
    </table>
    </form>
    <div id="pager">
      <%= will_paginate @materials,:prev_label => '«上一页',:next_label => '下一页»' %>
    </div>
  </div>
</div>